package ref;

import java.lang.annotation.ElementType;

/**
 * @author Mark
 * @date 2020/5/24 21:54
 * @description 所有类的类型class
 */
public class RefClassType {

    public static void main(String[] args) {

        /*
         1. 加载到内存
         2. 链接到
         3. 初始化
         4. 赋值
         */

        Class objectClass = Object.class;
        Class comparableClass = Comparable.class;
        Class<String[]> aClass = String[].class;
        Class<Override> overrideClass = Override.class;
        Class<ElementType> elementTypeClass = ElementType.class;
        Class<Integer> integerClass = Integer.class;
        Class<Void> voidClass = void.class;
        Class<Class> classClass = Class.class;
        System.out.println(objectClass);
        System.out.println(comparableClass);
        System.out.println(aClass);
        System.out.println(overrideClass);
        System.out.println(elementTypeClass);
        System.out.println(integerClass);
        System.out.println(voidClass);
        System.out.println(classClass);

        //只有元素类型一样,就是同一个class
        int[] ints = new int[10];
        int[] ints1 = new int[100];
        System.out.println("ints = " + ints.getClass().hashCode());
        System.out.println("ints1 = " + ints1.getClass().hashCode());

    }
}
